package com.food.admin.model;

import lombok.Data;

@Data
public class Result {
    private String code;
    private String message;
    private Object data;
    public Result(){
    }
    public Result(String code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }
    public static Result success(String code, String message,Object data){
        Result r = new Result();
        r.setCode(code);
        r.setData(data);
        r.setMessage(message);
        return r;
    }
    public static Result fail(String code,String message){
        Result r=new Result();
        r.setCode(code);
        r.setMessage(message);
        r.setData(null);
        return r;
    }

}

